package com.ihome.android.market2.view;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.ihome.android.academy.AppMgrActivity;
import com.ihome.android.academy.R;
import com.ihome.android.util.log.UserBehaviorLog;
import com.ihome.android.util.log.UserBehaviorLog.NotifyType;
import com.ihome.android.util.log.UserBehaviorLog.UserBehavior;

/**
 * 自定义一个按钮
 * @author wm
 * @category 主要使用在测试的悦学堂
 * @date 2015-08-03
 */
public class SmallTwoBottom extends LinearLayout implements View.OnClickListener {
	private LayoutInflater	mInflater;
	private TextView		search_course;
	private TextView		my_course;			
	

	public SmallTwoBottom(Context context) {
		super(context);
		mInflater = LayoutInflater.from(context);
		initial();
	}

	public SmallTwoBottom(Context context, AttributeSet attrs) {
		super(context, attrs);
		mInflater = LayoutInflater.from(context);
		initial();
	}

	void initial() {
		View Temp = mInflater.inflate(R.layout.small_two_bottom, this);
		search_course = (TextView) Temp.findViewById(R.id.search_course);
		my_course = (TextView) Temp.findViewById(R.id.my_course);
		search_course.setOnClickListener(this);
		my_course.setOnClickListener(this);
	}

	@Override
	public void setOnKeyListener(OnKeyListener l) {
		super.setOnKeyListener(l);
		search_course.setOnKeyListener(l);
		my_course.setOnKeyListener(l);
	}
	public void setNameTextSize(float textSize){
		search_course.setTextSize(textSize);
	}
	
	public void setBgImg(Drawable background){
		search_course.setBackground(background);
		my_course.setBackground(background);
	}
	
	public void setBgColor(int color){
		search_course.setBackgroundColor(color);
		my_course.setBackgroundColor(color);
	}
	
	public void setMoreTextSize(float textSize){
		my_course.setTextSize(textSize);
	}

	public void setNameTextColor(int textColor){
		search_course.setTextSize(textColor);
	}

	public void setMoreTextColor(int textColor){
		my_course.setTextSize(textColor);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.my_course:

			break;
		case R.id.search_course:

			break;
		default:
			break;
		}
	}

}
